Code style fixes in Language::isValidCode()
[lhc/web/wiklou.git] / languages / Language.php
index 84e7f37..2fd4bb7 100644 (file)
@@ -327,18 +327,18 @@ class Language {
         */
        public static function isValidCode( $code ) {
                static $cache = array();
-               if( isset( $cache[$code] ) ) {
+               if ( isset( $cache[$code] ) ) {
                        return $cache[$code];
                }
                // People think language codes are html safe, so enforce it.
                // Ideally we should only allow a-zA-Z0-9-
                // but, .+ and other chars are often used for {{int:}} hacks
                // see bugs 37564, 37587, 36938
-               $return =
+               $cache[$code] =
                        strcspn( $code, ":/\\\000&<>'\"" ) === strlen( $code )
                        && !preg_match( Title::getTitleInvalidRegex(), $code );
-               $cache[ $code ] = $return;
-               return $return;
+
+               return $cache[$code];
        }
 
        /**